<?php
include_once '../classes/dao.php';
$dao = new DAO();

if (!isset($_REQUEST["id"])) {
	exit;
}

$id = $_REQUEST["id"];
$musica = new Musica();
$musica->set_id($id);

try {
	$dao->deletar_musica($musica);
	header("Location: index.php?sucesso=Música deletada com sucesso");
}
catch (Exception $e) {
	header("Location: index.php?erro=".$e->getMessage());
}

?>